
#pragma once

#include <math.h>

#include "matrix4.h"
#include "quaternion.h"

struct vector2
{
	float x, y;
};

__declspec(dllexport) void vector2_create(float x, float y, struct vector2* v_out);
__declspec(dllexport) void vector2_add(const struct vector2* v1, const struct vector2* v2, struct vector2* v_out);
__declspec(dllexport) void vector2_barycentric(const struct vector2* v1, const struct vector2* v2, 
					  const struct vector2* v3, float amt1, float amt2, 
					  struct vector2* v_out);
__declspec(dllexport) void vector2_catmullrom(const struct vector2* v1, const struct vector2* v2,
					  const struct vector2* v3, const struct vector2* v4,
					  float amt, struct vector2* v_out);
__declspec(dllexport) void vector2_clamp(const struct vector2* v1, const struct vector2* min, const struct vector2* max, struct vector2* v_out);
__declspec(dllexport) void vector2_dist(const struct vector2* v1, const struct vector2* v2, float* f_out);
__declspec(dllexport) void vector2_distsqr(const struct vector2* v1, const struct vector2* v2, float* f_out);
__declspec(dllexport) void vector2_div(const struct vector2* v1, const struct vector2* v2, struct vector2* v_out);
__declspec(dllexport) void vector2_divf(const struct vector2* v, float div, struct vector2* v_out);
__declspec(dllexport) void vector2_dot(const struct vector2* v1, const struct vector2* v2, float* f_out);
__declspec(dllexport) void vector2_equals(const struct vector2* v1, const struct vector2* v2, int* result);
__declspec(dllexport) void vector2_hermite(const struct vector2* v1, const struct vector2* tang1,
				      const struct vector2* v2, const struct vector2* tang2,
				      float amt, struct vector2* v_out);
__declspec(dllexport) void vector2_len(const struct vector2* v, float* f_out);
__declspec(dllexport) void vector2_lensqr(const struct vector2* v, float* f_out);
__declspec(dllexport) void vector2_lerp(const struct vector2* v1, const struct vector2* v2,
				      float amt, struct vector2* v_out);
__declspec(dllexport) void vector2_max(const struct vector2* v1, const struct vector2* v2, struct vector2* v_out);
__declspec(dllexport) void vector2_min(const struct vector2* v1, const struct vector2* v2, struct vector2* v_out);
__declspec(dllexport) void vector2_mult(const struct vector2* v1, const struct vector2* v2, struct vector2* v_out);
__declspec(dllexport) void vector2_multf(const struct vector2* v1, float scale, struct vector2* v_out);
__declspec(dllexport) void vector2_negate(const struct vector2* v, struct vector2* v_out);
__declspec(dllexport) void vector2_norm(const struct vector2* v, struct vector2* v_out);
__declspec(dllexport) void vector2_reflect(const struct vector2* vec, const struct vector2* normal, struct vector2* v_out);
__declspec(dllexport) void vector2_smoothstep(const struct vector2* v1, const struct vector2* v2, float amt, struct vector2* v_out);
__declspec(dllexport) void vector2_subt(const struct vector2* v1, const struct vector2* v2, struct vector2* v_out);
__declspec(dllexport) void vector2_transform_matrix4(const struct vector2* pos, const struct matrix4* matrix, struct vector2* v_out);
__declspec(dllexport) void vector2_transform_quaternion(const struct vector2* v, const struct quaternion* rotation, struct vector2* v_out);
__declspec(dllexport) void vector2_transformnormal(const struct vector2* normal, const struct matrix4* matrix, struct vector2* v_out); 